<?php

use think\migration\Migrator;
use think\migration\db\Column;

class ControlPlanFromTsinghuaPlan extends Migrator
{
    /**
     * 清华方案
     */
    public function change()
    {
        $table = $this->table('control_plan_from_tsinghua_plan');
        $table
            //名称
            ->addColumn('plan_number', 'string', ['limit' => 50, 'comment'=>'预案编号',])
            ->addColumn('name', 'string', ['limit' => 50, 'comment'=>'预案名称',])
            ->addColumn('bureau_plan_id', 'string', ['limit' => 50, 'comment'=>'气象台的预案ID,如：0001到9999',])
            ->addColumn('confirm_scheme', 'integer', ['limit' => 2, 'default' => 0, 'comment'=>'确认方案，默认0确认1',])
            ->addColumn('create_time', 'integer', ['limit' => 11, 'comment'=>'入库时间',])

            //注释
            ->setComment('管控 - 清华预案名称')

            //引擎
            ->setEngine('InnoDB')
            ->save();
    }
}
